﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GarmentKingProto
{
    class Validation
    {
        internal static bool valueCheck(Form frm)
        {
            // This Flag checkes whether the loop have been thoroughly travelled
            bool flag = true;

            // Checks and if any text is missing
            foreach (Control cntrl in frm.Controls)
            {
                // If any textbox or combobox have no text, 
                // breaks d loop after marking FLAG as FALSE
                if ((cntrl is TextBox || cntrl is ComboBox) && cntrl.Text == "")
                {
                    // Marks FLAG as FALSE n Breaks loop
                    flag = false;
                    break;
                }
            }

            return flag;
        }
    }
}
